home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / GadUtil / ExtraCmds / fd2pragma.readme < prev    next >
Text File  |  1997-10-05  |  3KB  |  69 lines

  1. Short: Pragmas, LVOs for Aztec, Dice, SAS, Maxon
  2. Type: dev/misc
  3. Author: wiedmann@mailserv.zdv.uni-tuebingen.de
  4. Uploader: wiedmann@mailserv.zdv.uni-tuebingen.de
  5.  
  6. This is a new version of my fd2pragma utility. It introduces support of
  7. tag functions, either by using the SAS pragma "tagcall" or by creating
  8. stub routines automatically. (Don't look at these functions: They look
  9. BCPL-like, horrible! But I hope, they'll work. ;-)
  10.  
  11. As before, the following pragma formats are supported:
  12.  
  13. Program     Recommended filename    pragma format (example)
  14.  
  15. Aztec-C     xxx_lib.h            #pragma amicall(xBase,0x1e,xfunc(a0,d1))
  16. Maxon        xxx_pragmas.h        #pragma amicall(xBase,0x1e,xfunc(a0,d1))
  17. Dice        xxx_pragmas.h        #pragma libcall xBase xfunc 1802
  18. SAS-C        xxx_pragmas.h        #pragma libcall xBase xfunc 1802
  19.  
  20. Aztec-As    xxx_lib.asm             xdef    _LVOxfunc
  21.                     _LVOxfunc    equ    -30
  22.  
  23. The tag functions are supported by certain comments. (Note, that the official
  24. includes from the Native Developer Update Kit don't have this comments
  25. included.) Lets look at an excerpt from the fd-file muimaster_lib.fd:
  26.  
  27. MUI_NewObjectA(class,tags)(a0,a1)
  28. *tagcall
  29. MUI_DisposeObject(obj)(a0)
  30. MUI_RequestA(app,win,flags,title,gadgets,format,params)(d0,d1,d2,a0,a1,a2,a3)
  31. *tagcall
  32. MUI_AllocAslRequest(type,tags)(d0,a0)
  33. *tagcalltags
  34.  
  35. The comments tell us, that MUI_NewObjectA, MUI_RequestA and
  36. MUI_AllocAslRequest should have stub routines. The respective names are
  37. MUI_NewObject, MUI_Request (as the comment has just the word tagcall) and
  38. MUI_AllocAslRequestTags (as the comment has the word tags included).
  39. Another possibility would be to write something like
  40.  
  41. SystemTagList(command,tags)(d1/d2)
  42. *tagcall-TagList+Tags
  43.  
  44. This would create a stub-routine SystemTags (dropping the word TagList,
  45. adding the word Tags).
  46.  
  47. Tag functions with arguments on the stack are supported in two different ways:
  48. - SAS-C allows special pragmas called "tagcall". Pragmas for the above
  49.   functions would look like this:
  50.  
  51.   #pragma tagcall MUIMasterBase MUI_NewObject 1e 9802
  52.   #pragma tagcall MUIMasterBase MUI_Request 2a BA9821007
  53.   #pragma tagcall MUIMasterBase MUI_AllocAslRequestTags 30 8002
  54.   #pragma tagcall DOSBase SystemTags 25e 2102
  55.  
  56. - Other C compilers need stub routines which are compiled separately and
  57.   linked to the program. fd2pragma can create these stub routines for you.
  58.  
  59.  
  60. The command template pf fd2pragma is
  61.     fd2pragma fdfile/a,aztec/k,as/k,dice/k,sas/k,maxon/k,tagdir/k
  62. where "fdfile" is the file to convert. The arguments aztec, as (Aztec-As),
  63. dice, sas and maxon are the pragma or LVO files that should be created.
  64. The tagdir argument is the name of a directory where to store stub routines.
  65.  
  66.  
  67. This program is in the public domain. Use it as you want, but WITHOUT ANY
  68. WARRANTY!
  69.